package com.lyncs.ods.modules.txn.model;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.lyncs.ods.annotation.NeedLog;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * SKU交易详情
 * </p>
 *
 * @author alex
 * @since 2022-04-09
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("txn_sku_detail")
@ApiModel(value = "TxnSkuDetail对象", description = "SKU交易详情")
public class TxnSkuDetail implements Serializable, CommonTxnSubItem {

    @ApiModelProperty("自增主键id")
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    @ApiModelProperty("订单id")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty("交付单id")
    @TableField("deliver_id")
    private Long deliverId;

    @ApiModelProperty("sku的id")
    @TableField("sku_id")
    private Long skuId;

    @ApiModelProperty("交付总数")
    @TableField("total_count")
    @NeedLog
    private BigDecimal totalCount;

    @ApiModelProperty("已交付数")
    @TableField("delivered_count")
    private BigDecimal deliveredCount;

    @ApiModelProperty("单价")
    @TableField("amount")
    @NeedLog
    private BigDecimal amount;

    @ApiModelProperty("总金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

    @ApiModelProperty("交易开始时间")
    @TableField("start_time")
    private LocalDateTime startTime;

    @ApiModelProperty("状态：1.已创建；2.部分交付；3.全部交付")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("备注")
    @TableField("remark")
    //@NeedLog
    private String remark;

    @ApiModelProperty("标签信息")
    @TableField(value = "tag_info", updateStrategy = FieldStrategy.IGNORED)
    private String tagInfo;

    @ApiModelProperty("创建者用户id")
    @TableField("creator")
    private Long creator;

    @ApiModelProperty("创建者所属企业ID")
    @TableField("creator_company_id")
    private Long creatorCompanyId;

    @ApiModelProperty("最后更新用户id")
    @TableField("last_updater")
    private Long lastUpdater;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @Override
    public Long getSubItemId() {
        return this.skuId;
    }
}
